<div class="ResultSearch">
<?php
     include 'Search_model.php';
     $optionID=$_GET['SearchOption'];
     $valueSearch=$_GET['ValueSearch'];
     //san pham khuyen mai
     if($optionID==1 )
     {
        $arr_topProduct= ProductDiscount($valueSearch);
        if($arr_topProduct!=NULL)
        {
            foreach ($arr_topProduct as $result) {
            ?>
         <table class="table" width="850" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <th  rowspan="4" scope="row" width="180px">&nbsp;<a href="../Search/SearchDetail.php=<?php echo $result[0];?>"><img width="133px" height="180px" src="<?php echo  $result[3]; ?>"></a></th>
                <td>&nbsp;<span style="color:#BF0000"><?php echo $result[1];?></span></td>
              </tr>
              <tr>
                <td>&nbsp;<span > Mô tả: <?php echo substr($result[2], 0, 200) ;?>...</span></td>
              </tr>
              <tr>
                  <td>&nbsp;<span> Giá bán: <?php echo $result[4];?> VND</span><span> &nbsp; &nbsp;Giảm giá: <?php echo $result[9];?>%</span></td>
              </tr>
               <tr>
                <td>&nbsp;<span style="color:#00007D"><a href="../Search/SearchDetail.php?ProductID=<?php echo $result[0];?>">Xem chi tiết</a></span></td>
              </tr>
            </table>
               <?php   
            }
        }
        else
            echo 'Không tìm thấy kết quả';
     }
     //san pham ban chay 
     if($optionID==2)
     {
        $arr_topProduct=  getTopProduct($valueSearch);
        if($arr_topProduct!=NULL)
        {
            foreach ($arr_topProduct as $result) {
            ?>
         <table class="table" width="850" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <th  rowspan="4" scope="row" width="180px">&nbsp;<a href="../Search/SearchDetail.php=<?php echo $result[0];?>"><img width="133px" height="180px" src="<?php echo  $result[4]; ?>"></a></th>
                <td>&nbsp;<span style="color:#BF0000"><?php echo $result[1];?></span></td>
              </tr>
              <tr>
                <td>&nbsp;<span > Mô tả: <?php echo substr($result[2], 0, 200) ;?>...</span></td>
              </tr>
              <tr>
                <td>&nbsp;<span> Giá bán: <?php echo $result[3];?> VND</span></td>
              </tr>
               <tr>
                <td>&nbsp;<span style="color:#00007D"><a href="../Search/SearchDetail.php?ProductID=<?php echo $result[0];?>">Xem chi tiết</a></span></td>
              </tr>
            </table>
               <?php   
            }
        }
        else
            echo 'Không tìm thấy kết quả';
     }
     //gia ban
     if($optionID==3)
     {
         
        $arr_searchPrice= searchPrice($valueSearch);
        if($arr_searchPrice!=NULL)
        {
            foreach ($arr_searchPrice as $result) {
            ?>
         <table class="table" width="850" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <th  rowspan="4" scope="row" width="180px">&nbsp;<a href="Search/SearchDetail.php"><img width="133px" height="180px" src="<?php echo  $result[4]; ?>"></a></th>
                <td>&nbsp;<span style="color:#BF0000"><?php echo $result[1];?></span></td>
              </tr>
              <tr>
                <td>&nbsp;<span > Mô tả: <?php echo substr($result[2], 0, 200) ;?>...</span></td>
              </tr>
              <tr>
                <td>&nbsp;<span> Giá bán: <?php echo $result[3];?> VND</span></td>
              </tr>
               <tr>
                <td>&nbsp;<span style="color:#00007D"><a href="../Search/SearchDetail.php?ProductID=<?php echo $result[0];?>">Xem chi tiết</a></span></td>
              </tr>
            </table>
               <?php   
            }
        }
        else
            echo 'Không tìm thấy kết quả';
     }
?>
</div>